﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace ViewLearn
{
    public class ProductFilterByPrice
    {
        public Decimal PriceMax { get; set; }
        public ProductFilterByPrice(decimal priceMax)
        {
            PriceMax = priceMax;
        }

        public bool ItemFilter(object obj)
        {
            ProductInfo product = obj as ProductInfo;
            if (product == null) return false;//没有数据就不要这一项
            return product.Price < PriceMax;
        }
    }
}
